using System;
using MathNet.Numerics.LinearAlgebra.Generic;

namespace Marvin
{
    /// <summary>
    /// A set of data used to train a machine learning algorithm. 
    /// </summary>
    public interface ITrainingSet<T> 
    {
        /// <summary>
        /// The training set as a two dimensional array
        /// where Data[1][2] can be read as the third feature of the second training example. 
        /// </summary>
        Matrix<double> GetX();

        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        T[] GetY(); 

        /// <summary>
        /// NumberOfTrainingExamples of the training set / number of training examples. 
        /// </summary>
        int NumberOfTrainingExamples { get; }

        /// <summary>
        /// Dimensions of the training examples. 
        /// </summary>
        int Dimensions { get; }

        /// <summary>
        /// Adds a training example to the training set. 
        /// </summary>
        /// <param name="x">New training examples (allows duplicate values).</param>
        /// <param name="y">Expected result</param>
        /// <exception cref="ArgumentException">Is thrown if the dimensions of the training example doesn't match the dimension of the training set.</exception>
        void Add(double[] x, T y);
    }
}